package com.shangyueshang.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shangyueshang.mapper.GoodsStorageFeeMapper;
import com.shangyueshang.model.GoodsStorageFee;
import com.shangyueshang.request.PageReq;
import com.shangyueshang.response.PageResult;
import com.shangyueshang.service.GoodsStorageFeeService;
import com.shangyueshang.utils.MyPageHelper;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author: JokeyZheng
 * @email: zhengjingfeng@ruqimobility.com
 * @created: 2023/5/16 15:02
 * @version: v1.0.0
 */
@Service
public class GoodsStorageFeeServiceImpl
		extends ServiceImpl<GoodsStorageFeeMapper, GoodsStorageFee> implements GoodsStorageFeeService {
	
	@Override
	public PageResult<GoodsStorageFee> findPage(PageReq pageReq) {
		Map<String, Object> lineParams = pageReq.getLineParams();
		PageInfo<GoodsStorageFee> pageInfo =
				PageHelper.startPage(
						pageReq.getPageNum(),
						pageReq.getPageSize()
				).doSelectPageInfo(
						() -> getBaseMapper().queryGoodsStorageFee(lineParams)
				);
		return MyPageHelper.getPageResult(pageInfo);
	}
}
